import request from "@/utils/request";

/**  案件分页查询参数 */
export interface CaseQuery {
  current?: number;
  pageSize?: number;
  lawyerId?: number;
  caseName?: string;
}

/** 案件分页对象 */
export interface CaseVO {
  current: number;
  pages: number;
  records: any;
  size: number;
  total: number;
}
/** 案件表单 */
export interface CaseForm {
  caseNo?: string;
  caseName?: string;
  caseStatus?: string;
  belongLawFirm?: number;
  belongLawFirmName?: string;
  belongLawyerId?: number;
  belongLawyerName?: string;
  caseDetail?: string;
  caseType?: string;
  id?: number;
}
class caseAPI {
  /** 获取案件列表 */
  static getCasePage(params: CaseQuery) {
    return request<any, CaseVO>({
      url: "/api/case_info/getPage",
      method: "post",
      data: params,
    });
  }
  /** 新增+修改 案件列表 */
  static updateCase(params: CaseForm) {
    return request({
      url: "/api/case_info",
      method: "post",
      data: params,
    });
  }
  /** 删除案件列表 */
  static deleteCase(ids: string) {
    return request({
      url: `/api/case_info/deleteBatch?ids=${ids}`,
      method: "delete",
      // data: params,
    });
  }
}

export default caseAPI;
